home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / tools / czesc_1 / cpdist / cpdist.h < prev    next >
C/C++ Source or Header  |  1994-01-12  |  3KB  |  100 lines

  1. /*
  2.  *  CPDIST.H
  3.  */
  4.  
  5. /*
  6.  * (c)Copyright 1992-93 by Tobias Ferber.
  7.  *
  8.  * This file is part of CPDIST.
  9.  *
  10.  * CPDIST is free software; you can redistribute it and/or modify
  11.  * it under the terms of the GNU General Public License as published
  12.  * by the Free Software Foundation; either version 1 of the License,
  13.  * or (at your option) any later version.
  14.  *
  15.  * CPDIST is distributed in the hope that it will be useful,
  16.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  * GNU General Public License for more details.
  19.  *
  20.  * You should have received a copy of the GNU General Public License
  21.  * along with CPDIST; see the file COPYING.  If not, write to
  22.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  */
  24.  
  25. #ifndef CPDIST_H
  26. #define CPDIST_H
  27.  
  28. #include <ctype.h>
  29. #include <stdarg.h>
  30. #include <stdio.h>
  31.  
  32. #include "version.h"
  33.  
  34. /* Please feel free to compile with the -DNO_PERROR */
  35. #ifdef NO_PERROR
  36. #define perror(s) do { printf("%s: I/O error detected.\n",s); } while(0)
  37. #endif /* NO_PERROR */
  38.  
  39. #ifdef __MSDOS__
  40. #define PSLASH            '\\'
  41. #else /* !__MSDOS__ */
  42. #define PSLASH            '/'
  43. #endif /* __MSDOS__ */
  44.  
  45. /* please do not change the option prefix.  This is not supported (yet) */
  46. #define OPTION_PREFIX     '-'
  47. #define DEFAULT_DISTFILE  "Distfile"
  48.  
  49. #define MAXIMUM_PATHNAME_LENGTH 256
  50.  
  51. /* options */
  52. #define OPT_REPLACEALL   (1)     /* don't ask before blowing it away */
  53. #define OPT_CHECKEXISTS  (1<<1)  /* check existence of source files */
  54. #define OPT_IGNOREERRORS (1<<2)  /* ignore syntax errors in distfiles */
  55. #define OPT_KEEPGOING    (1<<3)  /* keep going in case of I/O errors */
  56. #define OPT_DRYRUN       (1<<4)  /* just print, don't copy */
  57. #define OPT_SILENT       (1<<5)  /* don't print filenames when copying */
  58.  
  59. #define CP_REPLACEALL    ((global_opts & OPT_REPLACEALL) == OPT_REPLACEALL)
  60. #define CP_CHECKEXISTS   ((global_opts & OPT_CHECKEXISTS) == OPT_CHECKEXISTS)
  61. #define CP_IGNOREERRORS  ((global_opts & OPT_IGNOREERRORS) == OPT_IGNOREERRORS)
  62. #define CP_KEEPGOING     ((global_opts & OPT_KEEPGOING) == OPT_KEEPGOING)
  63. #define CP_DRYRUN        ((global_opts & OPT_DRYRUN) == OPT_DRYRUN)
  64. #define CP_SILENT        ((global_opts & OPT_SILENT) == OPT_SILENT)
  65.  
  66. #ifndef __P
  67.  
  68. #if defined (__STDC__) || defined(__cplusplus)
  69. #define __P(protos) protos
  70. #else /* !(__STDC__ || __cplusplus) */
  71. #define __P(protos) ()
  72. #endif /* __STDC__ || __cplusplus */
  73.  
  74. #endif /* !__P */
  75.  
  76. /* main.c */
  77. extern unsigned long global_opts;  /* command-line options */
  78. extern long global_buffersize;     /* size of our copy buffer */
  79.  
  80. /* msg.c */
  81. extern FILE *ferr;
  82. extern char *whoami;
  83. extern void echo __P( (const char *, ...) );
  84. extern void lerror __P( (int, const char *, ...) );
  85.  
  86. /* args.c */
  87. extern char *convert_args __P( (char *) );
  88. extern void display_args __P( (void) );
  89.  
  90. /* cpdist.c */
  91. extern int prepare_distribution __P( (char *, char *) );
  92.  
  93. /* keys.c */
  94. extern int ln_addnode __P( (char *) );
  95. extern int ln_member __P( (char *) );
  96. extern void ln_purge __P( (void) );
  97.  
  98. #endif /* !CPDIST_H */
  99.  
  100.